// post请求，获取菜单
export const postMenuApi = (params, config = {}) => uni.$uv.http.post('/ebapi/public_api/index', params, config)

// get请求，获取菜单，注意：get请求的配置等，都在第二个参数中，详见前面解释
export const getMenuApi = (data) => uni.$uv.http.get('/ebapi/public_api/index', data)
// 登录
export const login = (data) => uni.$uv.http.post('/user/client-login-by-code', data)
// 登录 根据微信参数获取手机号码
export const loginByPhone = (data) => uni.$uv.http.post('/user/client-login-by-phone-nuber', data)
// 创建订单
export const createOrder = (data) => uni.$uv.http.post('/order/client-create', data)

// 抽奖
// 奖品列表
// export const prizeListApi = (pCode) => uni.$uv.http.get(`/dictionary/list?pCode=${pCode}`)
export const prizeListApi = (data) => uni.$uv.http.post(`/product-prize/client-paged`,data)
// 活动抽奖功能
// export const lotteryApi = (productId) => uni.$uv.http.post(`/product/lottery/${productId}`)
export const lotteryApi = (productId) => uni.$uv.http.post(`/product/lottery-new/${productId}`)
// 抽中实物后填写 收货地址
// export const deliveryAddressApi = (data) => uni.$uv.http.post('/product/delivery', data)
export const deliveryAddressApi = (data) => uni.$uv.http.post('/product/delivery-new', data)
// 活动中心
export const activityListApi = (data) => uni.$uv.http.post('/product/client-paged', data)
// 活动详情
export const activityDetailApi = (data) => uni.$uv.http.get(`/product/${data.id}/client-detail-new?scene=` + data.scene)
// 生成海报
export const generatePosterApi = (id) => uni.$uv.http.post(`/product/${id}/generate-poster`)
// 当通过海报扫码进入的，得通过 scene 获取海报详情需要的id
export const getSceneValueApi = (scene) => uni.$uv.http.get('/wechat-mini/scene-value?scene=' + scene)

// 商户中心
// 小程序指定商户订单分页
export const orderPageApi = (data) => uni.$uv.http.post('/order/client-order-paged', data)
// 小程序指定商户订单分页- 修改订单
export const changeOrderApi = (data) => uni.$uv.http.put('/order/client-order-student', data)
// 个人中心
export const userinfoApi = (data) => uni.$uv.http.post('/user/client-user-fans-paged', data)
// 我的订单
export const userOrderApi = (data) => uni.$uv.http.post('/order/client-my-order-paged', data)
// 我的奖品
export const myPrizeListApi = (data) => uni.$uv.http.post('/user-prize-results/client-paged', data)
// 修改收货信息
export const changeReceivingApi = (data) => uni.$uv.http.post('/order/client-set-delivery', data)

export const productPagedApi = (id) => uni.$uv.http.get(`/product/paged/${id}`)

// 扫码更新用户所属老师类型
export const userTypeApi = (data) => uni.$uv.http.post(`/user/user-type`, data)

// 小程序-获取用户信息
export const wehchatMpUserDetail = () => uni.$uv.http.get(`/product/wechat-mp-user-detail`)

// 小程序端-获取活动详情的图片
export const clientPhotoDetail = (data) => uni.$uv.http.get(`/product/${data.id}/client-photo-detail`)
